home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / pcl / src-16f.lha / compiler / generic / vm-macs.lisp < prev    next >
Encoding:
Text File  |  1992-05-19  |  2.6 KB  |  93 lines

  1. ;;; -*- Package: VM -*-
  2. ;;;
  3. ;;; **********************************************************************
  4. ;;; This code was written as part of the CMU Common Lisp project at
  5. ;;; Carnegie Mellon University, and has been placed in the public domain.
  6. ;;; If you want to use this code or any part of CMU Common Lisp, please contact
  7. ;;; Scott Fahlman or slisp-group@cs.cmu.edu.
  8. ;;;
  9. (ext:file-comment
  10.   "$Header: vm-macs.lisp,v 1.6 92/04/21 04:27:52 wlott Exp $")
  11. ;;;
  12. ;;; **********************************************************************
  13. ;;;
  14. ;;; $Header: vm-macs.lisp,v 1.6 92/04/21 04:27:52 wlott Exp $
  15. ;;;
  16. ;;;    This file contains some macros and constants that are object-format
  17. ;;; specific or are used for defining the object format.
  18. ;;;
  19. ;;; Written by William Lott and Christopher Hoover.
  20. ;;; 
  21. (in-package "VM")
  22.  
  23. (export '(*assembly-unit-length*))
  24.  
  25.  
  26.  
  27. ;;;; Other random stuff.
  28.  
  29. ;;; PAD-DATA-BLOCK -- Internal Interface.
  30. ;;;
  31. ;;; This returns a form that returns a dual-word aligned number of bytes when
  32. ;;; given a number of words.
  33. ;;;
  34. (defmacro pad-data-block (words)
  35.   `(logandc2 (+ (ash ,words word-shift) lowtag-mask) lowtag-mask))
  36.  
  37. ;;; DEFENUM -- Internal Interface.
  38. ;;;
  39. (defmacro defenum ((&key (prefix "") (suffix "") (start 0) (step 1))
  40.            &rest identifiers)
  41.   (let ((results nil)
  42.     (index 0)
  43.     (start (eval start))
  44.     (step (eval step)))
  45.     (dolist (id identifiers)
  46.       (when id
  47.     (multiple-value-bind
  48.         (root docs)
  49.         (if (consp id)
  50.         (values (car id) (cdr id))
  51.         (values id nil))
  52.       (push `(defconstant ,(intern (concatenate 'simple-string
  53.                             (string prefix)
  54.                             (string root)
  55.                             (string suffix)))
  56.            ,(+ start (* step index))
  57.            ,@docs)
  58.         results)))
  59.       (incf index))
  60.     `(eval-when (compile load eval)
  61.        ,@(nreverse results))))
  62.  
  63.  
  64.  
  65. ;;;; Some general constant definitions:
  66.  
  67. ;;; The number of bits per element in the assemblers code vector.
  68. ;;;
  69. (defparameter *assembly-unit-length* 8)
  70.  
  71. (in-package "C")
  72.  
  73. (export '(fasl-file-implementations
  74.       pmax-fasl-file-implementation
  75.       sparc-fasl-file-implementation
  76.       rt-fasl-file-implementation
  77.       rt-afpa-fasl-file-implementation
  78.       x86-fasl-file-implementation))
  79.  
  80. ;;; Constants for the different implementations.  These are all defined in
  81. ;;; one place to make sure they are all unique.
  82.  
  83. (defparameter fasl-file-implementations
  84.   '(nil "Pmax" "Sparc" "RT" "RT/AFPA" "x86"))
  85. (defconstant pmax-fasl-file-implementation 1)
  86. (defconstant sparc-fasl-file-implementation 2)
  87. (defconstant rt-fasl-file-implementation 3)
  88. (defconstant rt-afpa-fasl-file-implementation 4)
  89. (defconstant x86-fasl-file-implementation 5)
  90.  
  91. ;;; The maximum number of SCs in any implementation.
  92. (defconstant sc-number-limit 32)
  93.